@extends('layouts.app')

@section('content')
<style>

</style>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">Dashboard</div>

                <div class="card-body">
                    @if (session('status'))
                    <div class="alert alert-success" role="alert">
                        {{ session('status') }}
                    </div>
                    @endif
                    <table class="table">
                        <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col">图标</th>
                                <th scope="col">名称</th>
                                <th scope="col">版本</th>
                                <th scope="col">开发者</th>
                                <th scope="col">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach($games as $game)
                            <tr>
                                <th scope="row">{{$game->id}}</th>
                                <td>
                                    <img class="" src="{{$game->icon}}" style="width:65px; height:65px; ">
                                </td>
                                <td>{{ $game->name }}</td>
                                <td>{{ $game->version}}</td>
                                <td>{{ $game->developer}}</td>
                                <td>
                                    <a href="/edit/{{$game->id}}" class="btn btn-primary">编辑</a>
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
